import request from '@/axios';

export const getLeftTree = () => {
    return request({
        url: '/blade-desk/device/leftTree',
        method: 'get'
    })
}

export const getDeviceList = (params) => {
    return request({
        url: '/blade-desk/device/selectPageByTreeId',
        method: 'get',
        params
    })
}

export const add = (row) => {
    return request({
        url: '/blade-desk/device/save',
        method: 'post',
        data: row
    })
}

export const update = (row) => {
    return request({
        url: '/blade-desk/device/update',
        method: 'post',
        data: row
    })
}

export const remove = (ids) => {
    return request({
        url: '/blade-desk/device/remove',
        method: 'post',
        params: {
            ids,
        }
    })
}

export const getDetail = (params) => {
    return request({
        url: '/blade-desk/device/detail',
        method: 'get',
        params
    })
}

export const getDiscountCurve = (params) => {
    return request({
        url: '/blade-desk/device/discountCurve',
        method: 'get',
        params
    })
}

export const deviceControl = (row) => {
    return request({
        url: '/blade-desk/device/deviceControl',
        method: 'post',
        data: row
    })
}

